package org.wishwork.exception;

/**
 * @description: 自定义异常类
 * @author: WangYX
 * @create: 2022-03-16 17:27
 * @Version: 1.0.0
 **/
public class JSTException extends RuntimeException {

    /**
     * 错误码
     */
    private String code;

    /**
     * 错误消息
     */
    private String message;


    public JSTException(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public JSTException(ExceptionEnum exceptionEnum) {
        this.code = exceptionEnum.getCode();
        this.message = exceptionEnum.getMessage();
    }

    public JSTException(ExceptionEnum exceptionEnum, String message) {
        this.code = exceptionEnum.getCode();
        this.message = message;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
